<?php 
$appId = 'wxe214ac48790c622f';
$secret = '62d3091e10b72a50a8a2c4f758a799b2';
$url='https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$appId.'&secret='.$secret;
$getToken=json_decode(file_get_contents($url),true);
$thisToken=$getToken['access_token'];
var_dump($getToken);

echo $thisToken;
echo "<br /><br />";
$url='https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token='.$thisToken;
echo $url;
echo "<br />";


//$gettoken=json_decode(file_get_contents('./log/component_access_token.json'),true);
//$thisToken=$gettoken['component_access_token'];
$data='{
    "touser":"oE4KPwQ0-K7tWt_3eJIkj2IMgIR8",
    "msgtype":"text",
    "text":
    {
         "content":"Hello World"
    }
}';
$data='{
  "touser":"oE4KPwQ0-K7tWt_3eJIkj2IMgIR8",
  "msgtype":"wxcard",
  "wxcard":
  {              
   "card_id":"pE4KPwWtNWU0ITTo6DFLaCp8oOOU"        
   }
}';

$res = json_decode(http_request($url, $data), true);
var_dump($res);

function http_request($url, $data = null)
{
	$curl = curl_init();
	curl_setopt($curl, CURLOPT_URL, $url);
	curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
	curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
	if (!empty($data)){
		curl_setopt($curl, CURLOPT_POST, 1);
		curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
	}
	curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
	$output = curl_exec($curl);
	var_dump($output);
	curl_close($curl);
	return $output;
}